﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace QYmall.Core.Model.Models
{
    /// <summary>
    /// 商户收藏表
    /// </summary>
    public class MerchantFavorite
    {
        /// <summary>
        /// 自增ID
        /// </summary>
        [Display(Name = "自增ID")]
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; }

        /// <summary>
        /// 所属商户ID
        /// </summary>
        [Display(Name = "所属商户")]
        [ForeignKey("Merchant")]
        public int MerchantId { get; set; }

        /// <summary>
        /// 所属用户
        /// </summary>
        [Display(Name = "所属用户")]
        public int UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Display(Name = "用户名")]
        [StringLength(128)]
        public string? UserName { get; set; }

        /// <summary>
        /// 关注时间
        /// </summary>
        [Display(Name = "关注时间")]
        public DateTime AddTime { get; set; } = DateTime.Now;


        /// <summary>
        /// 商户信息
        /// </summary>
        public Merchants? Merchant { get; set; }
    }
}
